package com.jeesite.modules.rt.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.rt.entity.RtDailiDevice;
import com.jeesite.modules.rt.dao.RtDailiDeviceDao;

/**
 * rt_daili_deviceService
 * @author 李寒冰
 * @version 2024-12-17
 */
@Service
public class RtDailiDeviceService extends CrudService<RtDailiDeviceDao, RtDailiDevice> {

	/**
	 * 获取Sn
	 */
	public RtDailiDevice getOneBySn(String sn) {
		RtDailiDevice rtDailiDevice = new RtDailiDevice();
		rtDailiDevice.setSn(sn);
		List<RtDailiDevice> list = findList(rtDailiDevice);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}
	
	/**
	 * 获取单条数据
	 * @param rtDailiDevice
	 * @return
	 */
	@Override
	public RtDailiDevice get(RtDailiDevice rtDailiDevice) {
		return super.get(rtDailiDevice);
	}
	
	/**
	 * 查询分页数据
	 * @param rtDailiDevice 查询条件
	 * @param rtDailiDevice page 分页对象
	 * @return
	 */
	@Override
	public Page<RtDailiDevice> findPage(RtDailiDevice rtDailiDevice) {
		return super.findPage(rtDailiDevice);
	}
	
	/**
	 * 查询列表数据
	 * @param rtDailiDevice
	 * @return
	 */
	@Override
	public List<RtDailiDevice> findList(RtDailiDevice rtDailiDevice) {
		return super.findList(rtDailiDevice);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param rtDailiDevice
	 */
	@Override
	@Transactional
	public void save(RtDailiDevice rtDailiDevice) {
		super.save(rtDailiDevice);
	}
	
	/**
	 * 更新状态
	 * @param rtDailiDevice
	 */
	@Override
	@Transactional
	public void updateStatus(RtDailiDevice rtDailiDevice) {
		super.updateStatus(rtDailiDevice);
	}
	
	/**
	 * 删除数据
	 * @param rtDailiDevice
	 */
	@Override
	@Transactional
	public void delete(RtDailiDevice rtDailiDevice) {
		super.delete(rtDailiDevice);
	}
	
}